<template>
  <!-- #ifdef H5 -->
    <mtitles  title="开卡" bgColor="#56BF7A" :delta='3' color="#fff" isBack></mtitles>
    <!-- #endif -->
	<view class="containbox">
		<view class="topfill">
			<view class="topNavBox">
				<view class="cu-steps padding-top">
					<view class="cu-item" :class="index>navClass?'':'active'" v-for="(item,index) in basicsList" :key="index">
						<text :class="'cuIcon-' + item.cuIcon"></text> 
						<text class="cu_name">{{item.name}}</text>
						
					</view>
				</view>
			</view>
		</view>
		<view class="centerFill"></view>
		<block v-if="navClass==0">
			<view class="centerSection">
				<view class="subTopbox">
					<view class="in_putbox padding-lr">
						<view class="input2_itm flex align-center">
							<view class="text-c6 iptit">
								充值门店
							</view>
							<!-- <input class="in_input flex-sub text-left" type="text" disabled placeholder-class="plashd" v-model="shopName" placeholder="请选择门店" /> -->
							<view class="flex-sub padding-right-xs"  @click.stop="mnavTo('/pages/others/positionStores/positionStores?source=recharge')">
								{{ rechargeShop.name || '请选择门店' }}
							</view>
						</view>
						<view class="input2_itm flex align-center">
							<view class="text-c6 iptit">
								推荐技师
							</view>
							<input class="in_input flex-sub text-left" type="number" v-model="techNo" placeholder-class="plashd" placeholder="请输入技师编号" />
						</view>
					</view>
				</view>
				<scroll-view scroll-y="true" class="rechaScrBox margin-top-sm">
					<view class="padding-lr-sm">
						<view v-for="(item,index) in 6" :key="index" :class="{act:rechClass==index}" @click="rechClass=index" class="recItem text-center text-c6 nponter">
							<view class="rec_contain flex flex-direction justify-center p_rlt">
								<view class="recTips text-white text-xs text-center">
									9折
								</view>
								<view class="text-xl text-bold">
									1000
								</view>
								<view class="text-sm margin-top-xs">
									售价12000
								</view>
								<view class="text-sm">
									赠200
								</view>
							</view>
						</view>
					</view>
				</scroll-view>
			</view>
			<view class="full_btn margin-top-sm" @click="BasicsSteps">
				下一步
			</view>
		</block>
		<block v-else-if="navClass==1">
			<view class="centerSection padding-lr">
				<view class="text-bold padding-top">
					基本信息
				</view>
				<view class="inputItem flex align-center">
					<view class="in_tit text-c6">
						手&nbsp;机&nbsp;号
						<text class="text-nred">*</text>
					</view>
					<input class="in_input flex-sub" type="number" placeholder-class="plashd" maxlength="11" v-model="inputPhone" focus="auto" placeholder="请输入想要绑定的手机号码" />
					<text class="cuIcon-right margin-left-xs text-c6"></text>
				</view>
				<view class="inputItem flex align-center">
					<view class="in_tit text-c6">
						支付密码
						<text class="text-nred">*</text>
					</view>
					<input class="in_input flex-sub" type="password" placeholder-class="plashd" @input="tapInputView" maxlength="6" v-model="inputPSW" placeholder="请输入会员卡密码" />
					<!-- <text class="cuIcon-right margin-left-xs text-c6"></text> -->
					<text class="text-c9">{{inputPSW.length}}/6</text>
				</view>
				<view class="inputItem flex align-center">
					<view class="in_tit text-c6">
						姓&nbsp;&nbsp;&nbsp;名
					</view>
					<input class="in_input flex-sub" type="number" placeholder-class="plashd" maxlength="12" v-model="inputName" placeholder="请输入您的姓名" />
					
				</view>
				<view class="inputItem flex align-center">
					<view class="in_tit text-c6">
						生&nbsp;&nbsp;&nbsp;日
					</view>
					<input class="in_input flex-sub" type="text" disabled placeholder-class="plashd" v-model="inputDate" placeholder="选择您的阳历生日日期" />
					<text class="cuIcon-right margin-left-xs text-c6"></text>
				</view>
				<view class="padding-top-lg text-c9">
					提示：电子卡可以到颐而康任意门店进行消费
				</view>
			</view>
			<view class="full_btn margin-top-sm" @click="BasicsSteps">
				下一步
			</view>
		</block>
		<view v-else class="centerSection">
			
		</view>
		
	</view>
</template>

<script lang="ts" setup>
	import { ref } from "vue";
	import { onLoad,onShow} from '@dcloudio/uni-app';
	import { mnavTo } from '@/utils/helper';
	import { useShopStore } from '@/stores/shopStore';
	const shopStore = useShopStore()
	const navClass=ref(0)
	const techNo=ref('')
	const inputPSW=ref('')
	const inputPhone=ref('')
	const inputName=ref('')
	const inputDate=ref('')
	const rechargeShop = ref({
		name: '',
		id: ''
	});
	const basicsList=ref([{
	 	cuIcon: 'title',//roundcheckfill
	 	name: '选择开卡金额'
	 }, {
	 	cuIcon: 'title',
	 	name: '设置卡密码'
	 }, {
	 	cuIcon: 'title',
	 	name: '支付'
	 }, {
	 	cuIcon: 'title',
	 	name: '完成'
	 }])
	const rechClass=ref(0)
	onShow(()=>{
		initParams()
	})
	const	BasicsSteps=()=> {
		navClass.value= navClass.value== basicsList.value.length - 1 ? 0 : navClass.value + 1				
	}
	const	tapInputView=()=>{
		
	}
	const initParams = () => {
		if (!rechargeShop.value.id || shopStore.rechargeShop.nmember_id) {
			rechargeShop.value.name = shopStore.rechargeShop.vnick || shopStore.shopInfo.vnick || '';
			rechargeShop.value.id = shopStore.rechargeShop.nmember_id || shopStore.shopInfo.nmember_id || '';//shopStore.curSellerMemberId;
			shopStore.rechargeShop.nmember_id && shopStore.setRechargeShop({})
		}
	}
</script>

<style lang="scss">
	.topfill{
		width: 100vw;
		height: 200rpx;
		background: #56BF7A;
	}
	.topNavBox{
		height: 210rpx;
		width: calc(100vw - 32rpx);
		background: #fff;
		box-shadow: 0px 2px 18rpx rgba(0, 0, 0, 0.08);
		border-radius: 16rpx;
		position: relative;
		top: 64rpx;
		left: 16rpx;
	}
	.centerFill{
		width: 100vw;
		height: 64rpx;
	}
	.centerSection{
		height: calc(100vh - 444rpx);
		width: calc(100vw - 32rpx);
		margin: 20rpx 0 0 16rpx;
		background: #fff;
		box-shadow: 0px 2px 18rpx rgba(0, 0, 0, 0.08);
		border-radius: 8px;
	}
	.input2_itm{
		height: 110rpx;
		border-bottom: 1px solid #F3F3F3;
	}
	.iptit{
		width: 180rpx;
	}
	.rechaScrBox{
		height: calc(100% - 250rpx);//240
		.recItem{
			display: inline-block;
			width: 200rpx;
			height: 200rpx;
			background: #F0F0F0;
			border-radius: 16rpx;
			margin:36rpx 36rpx 0 0;
			&:nth-child(3n){
				margin:36rpx 0 0 0;
			}
			&.act{
				color: #fff;
				background: #56BF7A;
			}
		}
		.rec_contain{
			width: 100%;
			height: 100%;
		}
	}
	.recTips{
		min-width: 74rpx;
		height: 28rpx;
		line-height: 29rpx;
		background: linear-gradient(270deg, #FF7A00 0%, #F7B500 151.35%);
		border-radius: 45rpx 32rpx 32rpx 0;
		position: absolute;
		right: -10rpx;
		top: -14rpx;
	}
	.inputItem{
		width: 100%;
		height: 100rpx;
		border-bottom: 1px solid #F3F3F3;
	} 
	.plashd{
		color: #D5D5D5;
	}
	.in_tit{
		width: 160rpx;
	}
	.cu-steps .cu-item::before,
	.cu-steps .cu-item::after,
	.cu-steps.steps-arrow .cu-item::before,
	.cu-steps.steps-arrow .cu-item::after {
		content: "";
		display: block;
		position: absolute;
		height: 0px;
		width: calc(100% - 80rpx);
		border-bottom: 2px solid #ccc;
		left: calc(0px - (100% - 80rpx) / 2);
		top: 38rpx;
		z-index: 0;
	}
	.cu_name{
		color: #999;
		font-weight: normal;
		font-size: 24rpx;
	}
	.cuIcon-title{
		font-size: 44rpx;
	}
	.cu-steps .cu-item.active{
		font-weight: bold;
		color: #56BF7A;
		.cu_name{
			color: #333;
		}
		&:before{
			font-weight: bold;
			border-bottom: 2px solid #56BF7A;
			// color: #56BF7A;
		}
		&:after{
			font-weight: bold;
			// color: #56BF7A;
			border-bottom: 2px solid #56BF7A;
		}
		.cuIcon-title{
			font-size: 50rpx;
		}
	}
	.full_btn{
		width: calc(100vw - 96rpx);
		margin-left: 38rpx;
	}
</style>
